package com.zhuxulin.android.test.net;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;

import com.zhuxulin.android.net.HttpClient;
import com.zhuxulin.android.net.IResult;
import com.zhuxulin.android.net.Request;
import com.zhuxulin.android.net.Request.Method;
import com.zhuxulin.android.test.R;
import com.zhuxulin.android.utils.LogUtil;

public class MainActivity extends Activity {

	protected static final String TAG = MainActivity.class.getSimpleName();
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.a_net);
	}
	public void Test(View v){
		Request request = new Request(Method.GET, "/api.php");
		request.setHost("http://api.ajaxsns.com");
		request.putParam("key", "free");
		request.putParam("appid", "0");
		request.putParam("msg", "127.0.0.1");
		HttpClient.getInstance(new IResult() {
			@Override
			public void onResult(String jsonString) {
				LogUtil.i(TAG, jsonString);
			}
		}).execute(request , null);
	}
}
